The invention relates generally to software debugging tools.
The GNU debugger (commonly referred to as “GDB”) is a software debugger that allows a user to debug programs remotely in a setup where the platform running GDB itself (the debugger system) is connected to the platform running the application being debugged (the target) via a serial port, network connection or some other means.
When debugging a remote target, GDB depends on the functionality provided by a debugging stub, a small piece of code that serves as the intermediary between the debugger system and the application or code being debugged. In conventional GDB implementations, GDB and the debugging stub communicate via a message-based protocol that contains commands to read and write memory, query registers, run the program and so forth. To set breakpoints, GDB uses read and write commands to replace an application instruction with an opcode that causes control to transfer to the debugging stub when that instruction is encountered. The debugging stub communicates the event to GDB and awaits further instruction from GDB. In a typical GDB session, when the debugging stub informs GDB when a breakpoint is encountered, GDB displays the appropriate code to the user, allowing the user to observe certain variables and the behavior of the program at the breakpoint.
GDB also provides tracepoints, which allow a user or software developer to record information about a running program with minimal interruption of the program. Tracepoints require additional debugging stub support to implement, but are handled in a manner similar to breakpoints.
For multiple active targets (for example, debugging of code on multiple CPUs in a multi-processing target environment), conventional GDB debugging solutions provide for debugging one target at a time, and maintain and use separate symbol tables for each of the targets. Such solutions therefore require significant memory capacity to support multiple sessions, that is, one session per target, and tend to incur high target switching latency as well due to the processing overhead associated with switching between different targets.